package com.able.wanandroid.module.tree;

import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.ViewModel;

import com.able.wanandroid.bean.ArticleBean;
import com.able.wanandroid.bean.Resource;
import com.able.wanandroid.bean.TreeBean;
import com.able.wanandroid.http.HttpClient;

import java.util.List;

/**
 * @author Able
 * @date 2018/10/25
 */
public class TreeViewModel extends ViewModel {
    private HttpClient httpClient = HttpClient.getInstance();
    private LiveData<Resource<List<TreeBean>>> treeLiveData;
    private LiveData<ArticleBean> articleTree;


    /**
     * 查询体系
     *
     * @return
     */
    public LiveData<Resource<List<TreeBean>>> getTreeData() {

        treeLiveData = httpClient.getTreeData();
        return treeLiveData;
    }

    public LiveData<ArticleBean> getArticleTree(int pageNo, int cid) {

        articleTree = httpClient.getArticleTree(pageNo, cid);
        return articleTree;
    }


}
